package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-03-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_commodity_details")
@ApiModel(value="OrderCommodityDetailsEntity对象", description="")
public class OrderCommodityDetailEntity implements Serializable {
    @ApiModelProperty(value = "卖品订单详情ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    @ApiModelProperty(value = "卖品订单ID")
    private Long orderCommodityId;
    
    @ApiModelProperty(value = "卖品ID")
    private Long commodityId;
    
    @ApiModelProperty(value = "卖品SKU ID")
    private Long skuId;

    @ApiModelProperty(value = "卖品规格信息")
    private String skuInfo;
    
    @ApiModelProperty(value = "应付价格")
    private BigDecimal price;
    
    @ApiModelProperty(value = "数量")
    private Integer num;

    @ApiModelProperty(value = "用户 id")
    private Long userId;
    
    @ApiModelProperty(value = "影院 id")
    private Long cinemaId;
    
    @ApiModelProperty(value = "租户 id")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;

    @TableField(exist = false)
    private CommodityEntity commodity;

    @TableField(exist = false)
    private CommoditySkuEntity commoditySku;

    @TableField(exist = false)
    private OrderCommodityDetailEntity orderCommodityDetail;
}
